using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Coin : MonoBehaviour
{
    public Vector3 rotationSpeed = new Vector3(0, 0, 100); // 控制旋转速度的向量
    void Start()
    {
        
    }

    void Update()
    {
        // 每帧更新对象的旋转
        transform.Rotate(rotationSpeed * Time.deltaTime);
    }
    
    //碰撞检测
    void OnCollisionEnter(Collision collision){
        if (collision.collider.tag == "Player") {
            CoinGameManager.Instance.CollectCoin(this.gameObject);
        }
    }
}
